<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 动物类
        class Animal{
            constructor(look){
                this.look=look;
            }
            eat(){
                return '动物吃东西...';
            }
        }
        // 两栖类
        class Amphibious extends Animal{
            constructor(color,look){
                super(look);
                this.color=color;
            }
            waterInto(){
                return '入水'; 
            }
            waterOut(){
                return '出水';
            }
        }
        // 哺乳类
        class Lactation extends Animal{
            constructor(color,leg,look){
                super(look);
                this.color=color;
                this.leg=leg;
            }
            creep(){
                return '爬行';
            }
        }
        // 鸟类
        class Bird extends Animal{
            constructor(color,wingspan,look){
                super(look);
                this.color=color;
                this.wingspan=wingspan;
            }
            fly(){
                return '飞行';
            }
        }
        // 虎类
        class Tiger extends Lactation{
            constructor(type,speed,color,leg,look){
                super(color,leg,look);
                this.type=type;
                this.speed=speed;
            }
            hunt(){
                return "老虎捕猎";
            }
        }
        // 鹰类 vision视力
        class Eagle extends Bird{
            constructor(type,speed,vision,color,wingspan,look){
                super(color,wingspan,look);
                this.type=type;
                this.speed=speed;
                this.vision=vision;
            }
            hunt(){
                return "老鹰捕猎";
            }
        }
        // 两栖动物实例
        let amphibious1=new Amphibious("褐色","圆形");
        console.log(amphibious1,amphibious1.eat(),amphibious1.waterInto(),amphibious1.waterOut());
        // 老虎实例
        let tiger1=new Tiger("东北虎","54km/h","黄色",4,'雄伟');
        console.log(tiger1,tiger1.eat(),tiger1.creep(),tiger1.hunt());
        // 老鹰实例
        let eagle1=new Eagle("苍鹰","80km/h",10,"灰色","2米","庞大");
        console.log(eagle1,eagle1.eat(),eagle1.fly(),eagle1.hunt());
    </script>
</body>
</html>